<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html; charset=UTF-8" language="java"
	import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/Web/common/page/jqueryMaster.jsp"%>
<%
	if( null == user){
		String url = root + "/common/toLoginPage.jhtml";
		response.sendRedirect(url);
	}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<script type="text/javascript" src="<%=root%>/Web/record/js/searchRecord.js"></script>

<script type="text/javascript">
function doSearch(){
	var params = $('#recordInfoTable').datagrid('options').queryParams;//先取得 datagrid 的查询参数
	var startdate = $('#startdate').datebox('getValue');
	var enddate = $('#enddate').datebox('getValue');

	if( startdate != '' && enddate != '' && startdate > enddate){
		$.messager.alert('错误提示','请输入开始日期以后的日期！','error');
		$('#enddate').focus();
	}

	
	//设置查询参数
	params['searchMethod'] = "CONDITION";
	params['startdate'] = $('#startdate').datebox('getValue');
	params['enddate'] = $('#enddate').datebox('getValue');
	params['carNum'] = $('#carNum').val();

	if( $('#carTypeCombox').combobox('getValue') != '00'){
		params['carType'] =  $('#carTypeCombox').combobox('getValue');
	} else {
		params['carType'] = '';
	}
	reloadTable();
}

function doBatchSearch(){
	var params = $('#recordInfoTable').datagrid('options').queryParams;//先取得 datagrid 的查询参数
	var startdate = $('#startdate').datebox('getValue');
	var enddate = $('#enddate').datebox('getValue');

	if( startdate != '' && enddate != '' && startdate > enddate){
		$.messager.alert('错误提示','请输入开始日期以后的日期！','error');
		$('#enddate').focus();
	}

	//设置查询参数
	params['searchMethod'] = "FILE";
	params['startdate'] = $('#startdate').datebox('getValue');
	params['enddate'] = $('#enddate').datebox('getValue');

	if( $('#carTypeCombox').combobox('getValue') != '00'){
		params['carType'] =  $('#carTypeCombox').combobox('getValue');
	} else {
		params['carType'] = '';
	}
	reloadTable();
}
</script>
</head>
<body>
	<input type="hidden" id = "searchMethod">
	<div style = "height:40px;padding-top:20px;">
		<label>车牌号码:</label><input type ="text" id = "carNum" maxlength="10" style="width:100px">
		&nbsp;&nbsp;&nbsp;&nbsp;
		<label>车辆类型:</label>
		<select id = "carTypeCombox" class="easyui-combobox" name="carType" panelHeight="auto" style="width:110px">
             <option value ="00">--- 车辆类型 ---</option>
             <option value ="02">小型车</option>
             <option value ="01">大型车</option>
        </select>
        &nbsp;&nbsp;&nbsp;&nbsp;
		<label>违章时间:</label>
		<input type="text" id="startdate" style = "width:90px" class="easyui-datebox">
		&nbsp;&nbsp;至&nbsp;&nbsp;
		<input type="text" id ="enddate" style = "width:90px" class="easyui-datebox">
		<div align = "right" style = "padding-right:10px;padding-right:10px;">
			<a href="#" class="easyui-linkbutton" icon="icon-search" onclick="doSearch();">查询</a>
			<a href="#" class="easyui-linkbutton" icon="icon-search" onclick="doBatchSearch();">特殊车辆批量查询</a>
		</div>
	</div>
	
	<div style="padding-top:10px;width:auto;height:auto;">
	<table id="recordInfoTable"
		title="违章记录一览"  
		border="0"
		cellspacing="0"
		cellpadding="0"
		iconCls="icon-search" 
		width="auto"             
		height="auto" 
		idField="breakRulePictureID" 
		pagination="true"
		fitColumns="true"
		remoteSort="false" 
		singleSelect="false" 
		showFooter="false"
		striped="true" 
		url = "<%=root %>/record/doSearchRecords.jhtml">
		<thead>
			<tr align="center">
				<th align ="center" field="breakRulePictureID" checkbox="true" width="100"></th>
				<th align ="center" field="number" width="35">序号</th>
				<th align ="left" field="carNum" width="100">车牌号码</th>
				<th align ="left" field="carType" width="100">车辆类型</th>
				<th align ="left" field="breakRuleType" width="100">违章类型</th>
				<th align ="left" field="breakRuleLocation" width="200">违章地点</th>
				<th align ="left" field="breakRuleTime" width="220">违章时间</th>
				<th align ="center" field="opt" formatter='optFormater' width="120">处理操作</th>
			</tr>
		</thead>
	</table>
	</div>
	
	<%-- show picture --%>
	<div id="showPic" icon="icon-search" style="padding-top:-40px;width:880px;height:450px" align = "center" >
		<h5 id="showPic_message" style="color: red;"></h5>
		<img id = "showPicImg" alt="违章图片" ondblclick = "">
	</div>
</body>
</html>